<template>
    <div class="app-container">
        <el-tabs v-model="activeName" v-loading="loading" :tab-position="tabPosition" @tab-click="handleClick">
            <el-row>
                <el-button style="float: right" type="primary" @click="save">保存</el-button>
            </el-row>
            <el-tab-pane label="诊断类型、手术字典类型配置" name="operAndDiag">
                <oper-and-diagnosis-config ref="operAndDiagnosisConfigRef" @modifyLoading="modifyLoading" />
            </el-tab-pane>
            <el-tab-pane label="其他">

            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script lang="ts" setup>
import operAndDiagnosisConfig from "@/views/base/individualizationConfig/operAndDiagnosisConfig.vue";
import {useUserStoreHook} from "@/store/modules/user";

const useUserStore = useUserStoreHook();
// 登录用户信息
const userInfo = <UserInfoBusi>useUserStore.user.userInfo
const loading = ref(false)
// 选项卡所在位置
const tabPosition = ref('left')
const activeName = ref('operAndDiag')
const operAndDiagnosisConfigRef = ref()
/** 配置保存 */
function save() {
    // 调用诊断类型、手术字典类型配置保存方法
    if (activeName.value === 'operAndDiag') {
        operAndDiagnosisConfigRef.value.submitForm()
    }
}
function handleClick(tab, _event) {
    console.log(tab);
}
function modifyLoading(type) {
    loading.value = type
}

</script>
<script lang="ts">
export default {
    name: "IndividualizationConfig"
}
</script>

<style scoped></style>
